-
Notifications
You must be signed in to change notification settings - Fork 1.1k
pc: fix: inline value when def indentation equals 2 #22990
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Co-Authored-By: Robert Marek <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks, nice find overall. I noted some other part that might need some changes.
noPrefixH ++ t.map(refIndent ++ _.stripPrefix(defIndent)).mkString("\n","\n", "") | ||
else | ||
((" " ++ h) :: t).map(refIndent ++ _.stripPrefix(defIndent)).mkString("\n", "\n", "") | ||
val header = if h.startsWith("{") then h else "\n" ++ refIndent ++ " " ++ h |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice find!
Although, I think that the h.startsWith("{")
is wrong too 🙈
The else
branch should most likely only be performed if the start line number of the rhs is different than the end line number of the definition.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks great! Nice fix!
Co-authored-by: Robert Marek <[email protected]>
Co-authored-by: Robert Marek <[email protected]> [Cherry-picked 48e8328][modified]
No description provided.